

/*code pre-treatment covariates*/

**age

encode q3, gen(age1)
encode q3_1, gen(age2)

gen age=cond(missing(age1), age2, age1)
sum age

**females

encode q4, gen(gender1)
encode q4_1,gen(gender2)

gen female=0
recode female(0=1)if gender1==2
recode female(0=1)if gender2==2
tab female

**college education

encode q5, gen(edu1)
encode q5_1,gen(edu2)

tab edu1, nolabel

gen college=0
recode college(0=1) if edu1==4
recode college(0=1) if edu2==4
tab college

**nativity

encode q6, gen(native1)
encode q6_1, gen(native2)

gen usborn=0
recode usborn(0=1) if native1==1
recode usborn(0=1) if native2==1
tab usborn

/*drop failed checks*/

encode q12, gen(check1)
drop if check1==2

encode q12_1, gen(check2)
drop if check2==2


********************************
**start coding english replies**
********************************

/*code pretreatment opinions, english*/

encode q7, gen(mask1)
encode q8, gen(limit1)
encode q9, gen (vaxproof1)
encode q10, gen(quaran1)

summ mask1 limit1 vaxproof1 quaran1


/*code posttreatment opinions, english*/

encode q13, gen(mask2)
encode q14, gen(limit2)
encode q15, gen(vaxproof2)
encode q16, gen(quaran2)

summ mask2 limit2 vaxproof1 quaran1


***summarize pre/post outcomes, english

summ mask1 mask2 limit1 limit2 vaxproof1 vaxproof2 quaran1 quaran2


*************************************
******now code spanish replies*******
*************************************

/*code pretreatment opinions, spanish*/

encode q7_1, gen(mask3)
encode q8_1, gen(limit3)
encode q9_1, gen (vaxproof3)
encode q10_1, gen(quaran3)

summ mask3 limit3 vaxproof3 quaran3


/*code posttreatment opinions, spanish*/

encode q13_1, gen(mask4)
encode q14_1, gen(limit4)
encode q15_1, gen(vaxproof4)
encode q16_1, gen(quaran4)

summ mask4 limit4 vaxproof4 quaran4


***summarize outcomes, spanish

summ mask3 mask4 limit3 limit4 vaxproof3 vaxproof4 quaran3 quaran4


/*balance check*/

**table SI.1

summ age female college usborn

**table SI.2

*generate comparisions between each treatment and control

gen engcol=.
recode engcol(.=0) if eng_ind_treat==1
recode engcol(.=1) if eng_col_treat==1

gen spanind=.
recode spanind(.=0) if eng_ind_treat==1
recode spanind(.=1) if span_ind_treat==1

gen spancol=.
recode spancol(.=0) if eng_ind_treat==1
recode spancol(.=1) if span_col_treat==1

ttest age, by(engcol)
ttest age, by(spanind)
ttest age, by(spancol)

ttest female, by(engcol)
ttest female, by(spanind)
ttest female, by(spancol)

ttest college, by(engcol)
ttest college, by(spanind)
ttest college, by(spancol)

ttest usborn, by(engcol)
ttest usborn, by(spanind)
ttest usborn, by(spancol)

*****use bonferroni correction for p-values from balance tests = .004
*****none of our balance tests meet this threshold


/*create single outcomes that indicate levels of opinion, pooled by language*/

gen mascarillas=cond(missing(mask4), mask2, mask4)
summ mascarillas

gen limitar=cond(missing(limit4), limit2, limit4)
summ limitar

gen vacprueba=cond(missing(vaxproof4), vaxproof2, vaxproof4)
summ vacprueba

gen cuarenta=cond(missing(quaran4), quaran2, quaran4)
summ cuarenta


**************************************
************main analyses ************
**************************************

***summarize pre-treatment outcomes, raw

summ mask1 mask3 limit1 limit3 vaxproof1 vaxproof3 quaran1 quaran3

***generate pretreatment outcomes across language

gen premask=cond(missing(mask3), mask1, mask3)
gen prelimit=cond(missing(limit3), limit1, limit3)
gen prevax=cond(missing(vaxproof3), vaxproof1, vaxproof3)
gen prequaran=cond(missing(quaran3), quaran1, quaran3)

***summarize pretreatment levels of outcomes

summ premask prelimit prevax prequaran
alpha premask prelimit prevax prequaran, std

***standardize pretreatment measures to 0-1 range

gen premask1=(premask-1)/6
gen prelimit1=(prelimit-1)/6
gen prevax1=(prevax-1)/6
gen prequaran1=(prequaran-1)/6

summ premask1 prelimit1 prevax1 prequaran1

***generate index of pre-treatment measures

gen pretreat1=(premask1+prelimit1+prevax1+prequaran1)/4
summ pretreat1

***standardize postreatment measures to 0-1 range

gen mascarillas1=(mascarillas-1)/6 
gen limitar1=(limitar-1)/6
gen vacprueba1=(vacprueba-1)/6
gen cuarenta1=(cuarenta-1)/6

summ mascarillas1 limitar1 vacprueba1 cuarenta1
alpha mascarillas1 limitar1 vacprueba1 cuarenta1, std

***generate index of posttreatment outcomes

alpha mascarillas1 limitar1 vacprueba1 cuarenta1, std
gen posttreat1=(mascarillas1+limitar1+vacprueba1+cuarenta1)/4
summ posttreat1

***compare ptreatreatment to postreatment

summ pretreat1 posttreat1


***table 2

*estimate ATEs, unadjusted

reg posttreat1 eng_col_treat span_ind_treat span_col_treat

*estimate ATEs, adjusted for pretreatment

reg posttreat1 eng_col_treat span_ind_treat span_col_treat pretreat1

